using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Configuration;

using IDAL;
using Entities;

namespace Bll
{
    public class CategoryBll
    {
        public IList<CategoryInfo> GetAll()
        {
            ICategoryDAO iCate = (ICategoryDAO) AssemblyLoader.Load("CategoryDAO");
            return iCate.GetAll();
        }

        public CategoryInfo GetByID(string categoryID)
        {
            ICategoryDAO iCate = (ICategoryDAO)AssemblyLoader.Load("CategoryDAO");
            return iCate.GetByID(categoryID);
        }

        public IList<CategoryInfo> GetByWareHouseID(string wareHouseID)
        {
            ICategoryDAO iCate = (ICategoryDAO)AssemblyLoader.Load("CategoryDAO");
            return iCate.GetByWareHouseID(wareHouseID);
        }

        public bool Insert(CategoryInfo cate)
        {
            ICategoryDAO iCate = (ICategoryDAO)AssemblyLoader.Load("CategoryDAO");
            return iCate.Insert(cate);
        }

        public bool Update(CategoryInfo cate)
        {
            ICategoryDAO iCate = (ICategoryDAO)AssemblyLoader.Load("CategoryDAO");
            return iCate.Update(cate);
        }

        public bool Delete(CategoryInfo cate)
        {
            ICategoryDAO iCate = (ICategoryDAO)AssemblyLoader.Load("CategoryDAO");
            return iCate.Delete(cate);
        }
    }
}
